Support HealtchCheck on tcp layer,avoid to produce needless http access log#46
Support HealtchCheck on tcp layer,avoid to produce needless http access log#46shi7161979 wants to merge 7 commits into
Conversation
| end | ||
|
|
||
| if typ ~= "http" then | ||
| if typ ~= "http" and typ ~= "tcp" then |
There was a problem hiding this comment.
ran into this while browsing: updating this check also requires updating the error message below
|
update error message ,thank you for your suggestion, Tieske。 |
|
why we don't merge this? @Tieske |
|
@Colstuwjx I commented on it, but I'm not a maintainer of this lib |
|
+1 ping @thibaultcha @spacewander |
|
Is there a reason this PR was never merged? |
spacewander
left a comment
There was a problem hiding this comment.
Would you add tests in https://github.com/openresty/lua-resty-upstream-healthcheck/tree/master/t?
| end | ||
| return peer_fail(ctx, is_backup, id, peer) | ||
| else | ||
| if ctx.type == "tcp" then |
There was a problem hiding this comment.
I would recommend to move the if block a level out, so the close & return inside it is more explicitly. Like if not ok ... end; if ctx.type == ....
Maybe I just missed it in a lot of notifications... Feel free to ping me again! |
|
Could anyone merge this MR? @spacewander @shi7161979 |
The author doesn't adjust the comment in #46 (review). We need test for new feature. |
local ok, err = hc.spawn_checker{
shm = "healthcheck", -- defined by "lua_shared_dict"
upstream = "foo.com", -- defined by "upstream"
type = "tcp",
interval = 2000, -- run the check cycle every 2 sec
timeout = 1000, -- 1 sec is the timeout for network operations
fall = 3, -- # of successive failures before turning a peer down
rise = 2, -- # of successive successes before turning a peer up
concurrency = 10, -- concurrency level for test requests
}